﻿<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
        body, html, #allmap {
            width: 100%;
            height: 100%;
            overflow: hidden;
            margin: 0;
            font-family: "微软雅黑";
        }
    </style>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=to1sjHDvE74iNOpQsRGHYPuAtXyxMno1"></script>
    <script src="~/Content/Scripts/jquery/jquery-1.9.1.min.js"></script>
    <script src="~/Content/Scripts/learunui-framework.js"></script>
    <script src="~/Content/Scripts/Zor_AJax.js"></script>
    <title>单击获取点击的经纬度</title>
</head>
<body>
    <div id="allmap"></div>
</body>
</html>
<script type="text/javascript">

    var stdata;
    getAjax("/Base/ListAddress","", function (data) {
        stdata = data;
    })
    // 百度地图API功能
    var map = new BMap.Map("allmap");
    map.centerAndZoom(stdata, 17);
    //单击获取点击的经纬度
    map.addEventListener("click", function (e) {
        var lng = e.point.lng;
        var lat = e.point.lat
        getPoint(lng, lat);
    });
    map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放

    function getPoint(lng, lat) {
        window.opener.document.getElementById('Bd_Longitude').value = lng;
        window.opener.document.getElementById('Bd_Latitude').value = lat;
        window.close();
    }
</script>